"""

"""
from kptest.config.enum import HostType, CommandType
from kptest.wrapper.wrapperbase import WrapperBase


class HkIpmi(WrapperBase):
    host_types = HostType.Local, HostType.HostOS
    command_types = CommandType.LOCAL_IPMICLI, CommandType.HOSTOS_IPMICLI
    modules = ["extension.wrapper.huakunipmi.hk_bmc_ipmi"]

    def __init__(self, _params=None):
        super(HkIpmi, self).__init__(_params)

    @staticmethod
    def parser_ipmi_rsp_params(params):
        if isinstance(params, dict):
            return {k.strip()
                    .replace("  ", " ")
                    .replace("  ", "")
                    .replace(" ", "_")
                    .lower(): v
                    for k, v in params.items()
                    }
        if isinstance(params, list):
            for n, i in enumerate(params):
                params[n] = HkIpmi.parser_ipmi_rsp_params(i)
        return params
